/*** Eclipse Class Decompiler plugin, copyright (c) 2012 Chao Chen (cnfree2000@hotmail.com) ***/
package com.qihoo.gamecenter.sdk.support.component;

import android.content.Context;
import android.view.animation.LinearInterpolator;
import android.view.animation.RotateAnimation;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;
import android.widget.TextView;
import com.qihoo.gamecenter.sdk.common.i.s;
import com.qihoo.gamecenter.sdk.support.d.a;

public class ProgressView extends LinearLayout {
    private ImageView a;
    private TextView b;
    private a c;

    public ProgressView(Context paramContext) {
        super(paramContext);
        this.c = a.a(paramContext);
        setLayoutParams(new LinearLayout.LayoutParams(-1, -1));
        setGravity(17);
        setVisibility(8);
        setClickable(true);
        a(paramContext);
    }

    private void a(Context paramContext) {
        LinearLayout localLinearLayout = new LinearLayout(paramContext);
        localLinearLayout.setLayoutParams(new LinearLayout.LayoutParams(-2, -2));
        localLinearLayout.setGravity(17);
        localLinearLayout.setMinimumWidth(s.b(paramContext, 300.0F));
        localLinearLayout.setMinimumHeight(s.b(paramContext, 90.0F));
        this.c.a(localLinearLayout, -1073741782);
        addView(localLinearLayout);
        LinearLayout.LayoutParams localLayoutParams = new LinearLayout.LayoutParams(s.b(paramContext, 25.0F), s.b(
                paramContext, 25.0F));
        localLayoutParams.rightMargin = s.b(paramContext, 8.0F);
        this.a = new ImageView(paramContext);
        this.a.setLayoutParams(localLayoutParams);
        localLinearLayout.addView(this.a);
        this.b = new TextView(paramContext);
        this.b.setLayoutParams(new LinearLayout.LayoutParams(-2, -2));
        this.b.setTextColor(-16777216);
        this.b.setTextSize(1, s.a(paramContext, 13.3F));
        localLinearLayout.addView(this.b);
    }

    private void a(ImageView paramImageView) {
        this.c.a(paramImageView, 1073741863);
        RotateAnimation localRotateAnimation = new RotateAnimation(0.0F, 360.0F, 1, 0.5F, 1, 0.5F);
        localRotateAnimation.setRepeatCount(-1);
        localRotateAnimation.setDuration(1000L);
        localRotateAnimation.setInterpolator(new LinearInterpolator());
        paramImageView.setAnimation(localRotateAnimation);
    }

    public ProgressView a(String paramString) {
        this.b.setText(paramString);
        return this;
    }

    public void a() {
        a(this.a);
        setVisibility(0);
    }

    public void b() {
        setVisibility(8);
        this.a.clearAnimation();
    }
}